<?php
include 'mysql.php';
$user = $_POST['name'];//用户名
$processing = $_POST['processing']; //提交的内容
$pwd = $_POST['pwd']; //用户密码
$money = $_POST['money']; //总价格多少
if($user != "" && $processing != "")
{
	$sql_1 = "select * from user where number = '$user' and password = '$pwd' ";
	//明天任务，写完早餐订单和查看购物车功能。
	$result = mysqli_query($link,$sql_1);
	$row = mysqli_num_rows($result);
	if($row)
	{
		// "INSERT INTO `all_order`(`ID`, `studentID`, `time`, `order_product`, `rmb`) VALUES ([value-1],[value-2],[value-3],[value-4],[value-5])"
		$sql_2 = "insert into `all_order`(`studentID`,`order_product`,`rmb`) VALUES ('".$user."','".$processing."','".$money."')" ;
		$result_2 = mysqli_query($link,$sql_2);
		if($result_2)
		{
			echo '提交成功';
		}
		// $sql_select = "select * from order_product whrer "这里最好查询一下，以防数据没有写进数据库
		else
		{
			echo '提交失败';
		}
	}
}
else
{
	echo '提交失败！有疑问请咨询管理员';
}













?>